package com.idnx.mynewsdemo.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.idnx.mynewsdemo.R;
import com.idnx.mynewsdemo.entity.NewsBean;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class MainAdapter extends BaseQuickAdapter<NewsBean.ResultBean.DataBean, BaseViewHolder> {
    public MainAdapter(List<NewsBean.ResultBean.DataBean> data) {
        super(R.layout.item_rv_main, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, NewsBean.ResultBean.DataBean dataBean) {
        baseViewHolder.setText(R.id.textView2, dataBean.getTitle());
        baseViewHolder.setText(R.id.textView3, dataBean.getDate());
    }
}
